package vn.edu.hcmuns.selab.arm.ui.wizards;

import org.dworks.bbcdt.ui.wizards.NewCProjectWizard;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

public class NewCFileWizard extends org.dworks.bbcdt.ui.wizards.CFileWizard
        implements INewWizard {

    private IStructuredSelection selection;

    private IWorkbench workbench;

    private NewCFilePage mainPage;

    /**
     * (non-Javadoc) Method declared on Wizard.
     */
    public void addPages() {
        mainPage = new NewCFilePage(workbench, selection);
        addPage(mainPage);
    }

    /**
     * (non-Javadoc) Method declared on IWorkbenchWizard
     */
    public void init(IWorkbench workbench1, IStructuredSelection selection1) {
        this.workbench = workbench1;
        this.selection = selection1;
        setWindowTitle("C File Creation Wizard");
        setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(
                NewCProjectWizard.class, "sheet.gif"));
    }

    /**
     * (non-Javadoc) Performs the finish() method of the <code>CFilePage</code>
     */
    public boolean performFinish() {
        return mainPage.finish();
    }

}
